import Vue from 'vue'
import Router from 'vue-router'

// import zbIndex from '@/views/zb_index' //指标首页
// import seeSQL from '@/views/see_SQL' //SQL页面
// import carryPreview from '@/views/carry_preview' //执行预览页面
// import stepList from '@/views/step_list' //抽取步骤清单
// import stepManage from '@/views/step_manage' //步骤管理环节
// import indicatorList from '@/views/indicator_list' //指标清单
// import indicatorCheck from '@/views/indicator_check' //指标数据核对
// import indexVerify from '@/views/index_verify' //指标数据校验
// import dataDetail from '@/views/data_detail' //指标数据核对清单
// import indexSearch from '@/views/index_search' //指标知识检索
// import modelSearch from '@/views/model_search' //模型知识检索
// import test from '@/views/test' //测试表格连线
Vue.use(Router)

/* Layout */
import Layout from '@/layout'

export default new Router({
  //默认是hash模式，不用写mode
  // mode: 'history',
  routes: [
    //默认跳转到指标首页
    {
      path: '/',
      component: Layout,
      redirect: '/zbIndex',
      // meta: {
      //   title: '数据处理过程管理'
      // },
      children: [{
          path: 'zbIndex',
          name: 'zbIndex',
          component: () => import('@/views/zb_index'),
          meta: {
            title: '数据处理过程管理'
          }
        },
        {
          path: 'indexSql',
          name: 'indexSql',
          hidden: true,
          component: () => import('@/views/index_SQL'),
          meta: {
            title: 'SQL预览',
            activeMenu: '/zbIndex'
          }
        },
        {
          path: 'stepList',
          name: 'stepList',
          // redirect: '/',
          hidden: true,
          component: () => import('@/views/step_list'),
          meta: {
            title: '步骤列表',
            activeMenu: '/zbIndex'
          },
          // children:[
          //   {
          //     path: '/stepManage',
          //     name: 'stepManage',
          //     hidden: true,
          //     component: () => import('@/views/step_manage'),
          //     meta: {
          //       title: '步骤管理'
          //     }
          //   }
          // ],
        },
        {
          path: 'stepManage',
          name: 'stepManage',
          hidden: true,
          component: () => import('@/views/step_manage'),
          meta: {
            title: '步骤管理',
            activeMenu: '/zbIndex'
          }
        }
      ]
    },
    {
      path: '/indicatorList',
      component: Layout,
      children: [{
        path: '',
        name: 'indicatorList',
        component: () => import('@/views/indicator_list'),
        meta: {
          title: '指标校验规则管理'
        }
      }]
    },
    {
      path: '/indexVerify',
      component: Layout,
      children: [{
        path: '',
        name: 'indexVerify',
        component: () => import('@/views/index_verify'),
        meta: {
          title: '指标数据校验结果'
        }
      }]
    },
    {
      path: '/verifySql',
      component: Layout,
      hidden:true,
      children: [{
        path: '',
        name: 'verifySql',
        component: () => import('@/views/verify_SQL'),
        meta: {
          title: 'SQL预览',
          activeMenu: '/indexVerify'
        }
      }]
    },
    {
      path: '/dataDetail',
      component: Layout,
      children: [{
        path: '',
        name: 'dataDetail',
        component: () => import('@/views/data_detail'),
        meta: {
          title: '指标数据核对管理'
        }
      }]
    },
    {
      path: '/dataSql',
      component: Layout,
      hidden: true,
      children: [{
        path: '',
        name: 'dataSql',
        component: () => import('@/views/data_SQL'),
        meta: {
          title: 'SQL预览',
          activeMenu: '/dataDetail'
        }
      }]
    },
    {
      path: '/indicatorCheck',
      component: Layout,
      children: [{
        path: '',
        name: 'indicatorCheck',
        component: () => import('@/views/indicator_check'),
        meta: {
          title: '指标汇总数据概览'
        }
      }]
    },



    //    {
    //      path: '/',
    //      redirect: '/zbIndex',
    //      hidden: true,
    //    },
    //    {
    //      path: '/zbIndex',
    //      name: 'zbIndex',
    //      component: zbIndex,
    //    },
    //    {
    //      path: '/sql',
    //      name: 'seeSQL',
    //      component: seeSQL,
    //    },
    //    {
    //      path: '/carryPreview',
    //      name: 'carryPreview',
    //      component: carryPreview,
    //    },
    //    {
    //      path: '/stepList',
    //      name: 'stepList',
    //      component: stepList,
    //    },
    //    {
    //      path: '/stepManage',
    //      name: 'stepManage',
    //      component: stepManage,
    //    },
    //    {
    //      path: '/indicatorList',
    //      name: 'indicatorList',
    //      component: indicatorList,
    //    },
    // {
    //   path: '/indicatorCheck',
    //   name: 'indicatorCheck',
    //   component: indicatorCheck,
    // },
    //    {
    //      path: '/indexVerify',
    //      name: 'indexVerify',
    //      component: indexVerify,
    //    },
    //    {
    //      path: '/dataDetail',
    //      name: 'dataDetail',
    //      component: dataDetail,
    //    },
    //    {
    //      path: '/indexSearch',
    //      name: 'indexSearch',
    //      component: indexSearch,
    //    },
    //    {
    //      path: '/modelSearch',
    //      name: 'modelSearch',
    //      component: modelSearch,
    //    },
    //    {
    //      path: '/test',
    //      name: 'test',
    //      component: test,
    //    }
  ]
})

// const routerPush = Router.prototype.push
// Router.prototype.push = function push(location) {
//   return routerPush.call(this, location).catch(error=> error)
// }
